Contents | Index | < Browse | Browse >

LETTERatexitULETTER Defines functions to be executed at program termination.

Overview
#include <stdlib.h>
error = atexit(function);

int error;
void (*function)(void)

Portability
ANSI

Description
atexit notifies the run-time library to execute the specified function without parameters when the program has finished. There is no limit as to the number of functions you may specify. Functions will be called in reverse order as declared. A function declared with atexit can not be removed.

Returns
This function returns zero is the function could be successfully installed and any other value otherwise.

See also
abort , exit